<?php

abstract class HttpController {

    private $error_msg = null;
    
    public abstract function doAction(HttpRequest $request,HttpResponse $response);

    public function addError($error_text) {
        if ($this->error_msg == null) {
            $this->error_msg = array();
        }
        $this->error_msg[] = $error_text;
    }

    public function setError($error_text) {
        $this->error_msg = $error_text;
    }

    public function getError() {
        return $this->error_msg;
    }

    public function hasError() {
        if ($this->error_msg == null || count($this->error_msg) == 0) {
            return false;
        }
        return true;
    }

}
